import java.util.HashMap;
import java.util.Map;

// 7295372
public class P73 {
	public static void main(String[] args) {
		int x = 12000;
		double from = (double) 1/ (double) 3;
		double to = (double) 1/ (double) 2;

		final Map<String, Double> m = new HashMap<String, Double>();
		
		for (int i = 1; i <= x; i++) {
			int start = (int) Math.floor((double) i / (double)3);
			int end = (int) Math.ceil((double) i / (double)2);
			
			for (int j = start; j < end; j++) {
				double value = (double)j/(double)i;
				
				if (value >= to) {
					continue;
				}
				
				if (value <= from) {
					continue;
				}
				
				long[] f = Util.reduce(j, i);
				//System.out.println(f[0] + "/" + f[1]);
				m.put(f[0] + "/" + f[1], value);
			}
			//System.out.println(i);
		}
		System.out.println(m.size());		
	}
}
